<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>学生列表</title>
    <link th:href="@{/login/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/login/css/signin.css}" rel="stylesheet">
</head>

<style>
    a {
        color: #fff;
    }
</style>

<body>
<div>
    <div>
        <h1 style="text-align: center">学生列表</h1>
        <div style="text-align: center;">
            <div class="btn-group">
                <form th:action="@{'/user/find'}">
                    <input name="name" class="form-control" type="text" placeholder="请输入用户名..."
                           style="float: left; width:70%;"/>
                    <input class="btn btn-primary form-control" type="submit" value="查询" style="width: 28%"/>
                </form>
            </div>
            &nbsp&nbsp
            <div class="btn-group">
                <button class="btn btn-primary form-control btn-sm"><a th:href="@{'/user/insertPage'}">添加用户</a>
                </button>
            </div>
        </div>
    </div>
    <div>
        <table class="table table-striped table-bordered table-hover text-center">
            <thead>
            <tr style="text-align:center">
                <th>编号</th>
                <th>姓名</th>
                <th>邮箱</th>
                <th>年龄</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="user:${userList}">
                <td th:text="${user.id}"></td>
                <td th:text="${user.name}"></td>
                <td th:text="${user.email}"></td>
                <td th:text="${user.age}"></td>
                <td>
                    <a class="btn btn-primary" th:href="@{'/user/updatePage/'+${user.id}}">修改</a>
                    <a class="btn btn-danger" th:href="@{'/user/delete/'+${user.id}}">删除</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>

</div>
</body>
</html>
